xen/arm: p2m: Invalidate the TLBs when write unlocking the p2m
authorJulien Grall <julien.grall@arm.com>
Thu, 15 Sep 2016 11:28:24 +0000 (12:28 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Wed, 28 Sep 2016 01:13:52 +0000 (18:13 -0700)
commit9162668fc7f5c1ae3163b3905fc58936c5332b6d
tree7c7187e15217d4fbc56f0b8b8af85974ec07f022
parent2fc1f3f2ac8c8aff2c58f5fa705e8d5bdb6abb2d
xen/arm: p2m: Invalidate the TLBs when write unlocking the p2m

Sometimes the invalidation of the TLBs can be deferred until the p2m is
unlocked. This is for instance the case when multiple mappings are
removed. In other case, such as shattering a superpage, an immediate
flush is required.

Keep track whether a flush is needed directly in the p2m_domain structure
to allow serializing multiple changes. The TLBs will be invalidated when
write unlocking the p2m if necessary.

Also a new helper, p2m_flush_sync, has been introduced to force a
synchronous TLB invalidation.

Finally, replace the call to p2m_flush_tlb by p2m_flush_tlb_sync in
apply_p2m_changes.

Note this patch is not useful today, however follow-up patches will make
advantage of it.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Tested-by: Tamas K Lengyel <tamas@tklengyel.com>
xen/arch/arm/p2m.c
xen/include/asm-arm/p2m.h